import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JPanel;

import java.awt.CardLayout;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Font;
import javax.swing.JTextField;

public class FullSeat extends JFrame {
	CardLayout card;
	JPanel suwon_panel;
	JPanel seoul_panel;
	JPanel busan_panel;
	JPanel panel;
	JPanel blank; 

	public FullSeat() {
		card = new CardLayout();
		setTitle("Full Stadium Picture");
		getContentPane().setLayout(null);

		panel = new JPanel();
		panel.setLayout(card);
		blank = new JPanel();	// if no button is clicked, blank page is appeared
		//Image of Suwon stadium
		suwon_panel = new JPanel() {
			public void paintComponent(Graphics g) {
				Image image = new ImageIcon("SuwonStadium.jpg").getImage();
				g.drawImage(image, 0, 0, null);
				setOpaque(false);
				super.paintComponent(g);
			}
		};
		//Image of Seoul stadium
		seoul_panel = new JPanel() {
			public void paintComponent(Graphics g) {
				Image image = new ImageIcon("SeoulStadium.jpg").getImage();
				g.drawImage(image, 0, 0, null);
				setOpaque(false);
				super.paintComponent(g);
			}
		};
		//Image of Busan Stadium
		busan_panel = new JPanel() {
			public void paintComponent(Graphics g) {
				Image image = new ImageIcon("Busan Stadium.jpg").getImage();
				g.drawImage(image, 0, 0, null);
				setOpaque(false);
				super.paintComponent(g);
			}
		};
		panel.setBounds(10, 117, 840, 485);
		getContentPane().add(panel);

		//Add image
		panel.add(blank);
		panel.add(suwon_panel, "suwon_picture");
		panel.add(seoul_panel, "seoul_picture");
		panel.add(busan_panel, "busan_picture");

		//Button Event
		JButton btnSuwon = new JButton("Suwon");
		btnSuwon.setFont(new Font("Consolas", Font.BOLD, 19));
		btnSuwon.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				card.show(panel, "suwon_picture");

			}
		});
		btnSuwon.setBounds(85, 41, 105, 49);
		getContentPane().add(btnSuwon);

		JButton btnSeoul = new JButton("Seoul");
		btnSeoul.setFont(new Font("Consolas", Font.BOLD, 19));
		btnSeoul.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				card.show(panel, "seoul_picture");

			}
		});
		btnSeoul.setBounds(384, 41, 105, 49);
		getContentPane().add(btnSeoul);

		JButton btnBusan = new JButton("Busan");
		btnBusan.setFont(new Font("Consolas", Font.BOLD, 19));
		btnBusan.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				card.show(panel, "busan_picture");

			}
		});
		btnBusan.setBounds(682, 41, 112, 49);
		getContentPane().add(btnBusan);

	}
}
